package perform.database;

import perform.annotations.ComplexIndex;
import perform.annotations.Indexes;

public class IndexesProcessor {
	
	private Indexes indexes;
	private ComplexIndexProcessor[] complexIndexes;
	private String indexDefinition;
	
	public IndexesProcessor(Indexes indexes) {
		this.indexes = indexes;
		ComplexIndex[] indxs = indexes.indexes();
		StringBuilder builder = new StringBuilder();
		complexIndexes = new ComplexIndexProcessor[indxs.length];
		for (int i = 0; i < indxs.length; i++) {
			complexIndexes[i] = new ComplexIndexProcessor(indxs[i]);
			builder.append(complexIndexes[i].getIndexDefinition());
		}
		indexDefinition = builder.toString();
	}
	public Indexes getIndexes() {
		return indexes;
	}
	public ComplexIndexProcessor[] getComplexIndexes() {
		return complexIndexes;
	}
	public String getIndexDefinition() {
		return indexDefinition;
	}

}
